
public class Food {
    private int energy;
    private String name;

    public Food(){
        this.energy = 10;
        this.name = "food";
    }
    public Food(int e,String n){
        this.energy = e;
        this.name = n;
    }
    public String toString(){
        return this.name+"能量["+energy+"]";
    }
    public int getEnergy(){
        return this.energy;
    }
    public String getName(){
        return this.name;
    }

}
